home *** CD-ROM | disk | FTP | other *** search
/ Aminet 38 / Aminet 38 (2000)(Schatztruhe)[!][Aug 2000].iso / Aminet / misc / math / libalgo.lha / algomath / makefile < prev    next >
Encoding:
Makefile  |  2000-05-30  |  1.7 KB  |  80 lines

  1. ################################################
  2. # ALGOMATH makefile  release 1.0.5      03.2000#
  3. ################################################
  4.  
  5. # replace this definition if you are using PGCC or EGCS(pentium)
  6. #PGCC = 1
  7. #EGCS = 1
  8.  
  9. # disable this definition if you dont include the
  10. # assembly function isprime(): #ASSEMBLY = 1
  11. ASSEMBLY = 1
  12.  
  13. VPATH = src obj
  14.  
  15. TEST = test
  16. OBJ = obj
  17. SRC = src
  18. AR = ar
  19. CC = gcc
  20.  
  21. ifdef WARNMODE
  22. WFLAGS = -Wall -W -Werror -Wno-sign-compare
  23. else
  24. WFLAGS = -Wall -Wno-sign-compare
  25. endif
  26.  
  27. ifdef EGCS
  28. OFLAGS = -march=pentium -mpentium -O3 -fomit-frame-pointer
  29. else
  30. OFLAGS = -O3 -fomit-frame-pointer
  31. endif
  32. ifdef PGCC
  33. OFLAGS = -mpentium -O6 -fomit-frame-pointer
  34. endif
  35.  
  36. CFLAGS = -I. -Isrc -I$(OBJ) -I$(TEST) $(WFLAGS) $(OFLAGS)
  37.  
  38. LIBALGO = lib/libalgo.a
  39. DEFS=defs.h
  40.  
  41. ifdef ASSEMBLY
  42. ASSOBJ = assembly/obj/isprime.o
  43. endif
  44.  
  45. OBJS = fact.o gcd.o goldbach.o init.o exit.o isprime.o \
  46.     rotatex.o sdigalt.o sortdig.o sumdigit.o numlen.o sumdiv.o \
  47.     swapdig.o extdigx.o repdig.o priarray.o priarrab.o primeab.o \
  48.     hail.o
  49.  
  50. LIB_OBJS = $(addprefix $(OBJ)/,$(OBJS))
  51.  
  52. .PRECIOUS: $(OBJ)/%.o
  53. .PHONY: all lib test msg2 clean
  54.  
  55. all: lib msg2
  56.  
  57. lib: $(LIBALGO) 
  58.  
  59. $(OBJ)/%.o: src/%.c
  60.     $(CC) $(CFLAGS) -c $^ -o $@
  61.  
  62. $(LIBALGO): $(LIB_OBJS) $(ASSOBJ)
  63.     $(AR) rvs $(LIBALGO) $(LIB_OBJS) $(ASSOBJ)
  64.  
  65. msg2:
  66.     @echo
  67.     @echo ############################################################
  68.     @echo All done.
  69.     @echo copy from lib/libalgo.a to your library path
  70.     @echo copy algomath.h to your include path
  71.     @echo To use Algomath, #include algomath.h and link with libalgo.a
  72.     @echo Example command line: gcc foobar.c -o foobar.exe -lalgo
  73.     @echo ############################################################
  74.  
  75. clean:
  76.     -rm -v $(LIB_OBJS)
  77.  
  78. #$(addprefix $(OBJ)/, $(OBJS)): $(DEPS)
  79.  
  80.